package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.WaterYcmeterDatahistory;
import com.ruoyi.system.mapper.WaterYcmeterDatahistoryMapper;
import com.ruoyi.system.service.IWaterYcmeterDatahistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 远传水表抄历史数据Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-26
 */
@Service
public class WaterYcmeterDatahistoryServiceImpl implements IWaterYcmeterDatahistoryService
{
    @Autowired
    private WaterYcmeterDatahistoryMapper waterYcmeterDatahistoryMapper;

    /**
     * 查询远传水表抄历史数据
     *
     * @param id 远传水表抄历史数据主键
     * @return 远传水表抄历史数据
     */
    @Override
    public WaterYcmeterDatahistory selectWaterYcmeterDatahistoryById(Long id)
    {
        return waterYcmeterDatahistoryMapper.selectWaterYcmeterDatahistoryById(id);
    }

    /**
     * 查询远传水表抄历史数据列表
     *
     * @param waterYcmeterDatahistory 远传水表抄历史数据
     * @return 远传水表抄历史数据
     */
    @Override
    public List<WaterYcmeterDatahistory> selectWaterYcmeterDatahistoryList(WaterYcmeterDatahistory waterYcmeterDatahistory)
    {
        return waterYcmeterDatahistoryMapper.selectWaterYcmeterDatahistoryList(waterYcmeterDatahistory);
    }

    @Override
    public List<WaterYcmeterDatahistory> selectWaterCyMeterDataList() {
        return waterYcmeterDatahistoryMapper.selectWaterCyMeterDataList();
    }

    /**
     * 新增远传水表抄历史数据
     *
     * @param waterYcmeterDatahistory 远传水表抄历史数据
     * @return 结果
     */
    @Override
    public int insertWaterYcmeterDatahistory(WaterYcmeterDatahistory waterYcmeterDatahistory)
    {
        waterYcmeterDatahistory.setCreateTime(DateUtils.getNowDate());
        return waterYcmeterDatahistoryMapper.insertWaterYcmeterDatahistory(waterYcmeterDatahistory);
    }

    @Override
    public int insertWaterCyMeterData(WaterYcmeterDatahistory waterYcmeterDatahistory) {
        waterYcmeterDatahistory.setCreateTime(DateUtils.getNowDate());
        return waterYcmeterDatahistoryMapper.insertWaterCyMeterData(waterYcmeterDatahistory);
    }

    /**
     * 修改远传水表抄历史数据
     *
     * @param waterYcmeterDatahistory 远传水表抄历史数据
     * @return 结果
     */
    @Override
    public int updateWaterYcmeterDatahistory(WaterYcmeterDatahistory waterYcmeterDatahistory)
    {
        waterYcmeterDatahistory.setUpdateTime(DateUtils.getNowDate());
        return waterYcmeterDatahistoryMapper.updateWaterYcmeterDatahistory(waterYcmeterDatahistory);
    }

    /**
     * 批量删除远传水表抄历史数据
     *
     * @param ids 需要删除的远传水表抄历史数据主键
     * @return 结果
     */
    @Override
    public int deleteWaterYcmeterDatahistoryByIds(Long[] ids)
    {
        return waterYcmeterDatahistoryMapper.deleteWaterYcmeterDatahistoryByIds(ids);
    }

    /**
     * 删除远传水表抄历史数据信息
     *
     * @param id 远传水表抄历史数据主键
     * @return 结果
     */
    @Override
    public int deleteWaterYcmeterDatahistoryById(Long id)
    {
        return waterYcmeterDatahistoryMapper.deleteWaterYcmeterDatahistoryById(id);
    }
}
